package avicit.bdp.dds.api.dto;

import avicit.bdp.core.constant.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * schedule parameters
 */
@ApiModel(value = "ScheduleParam", description = "流程定义定时参数DTO")
public class ScheduleParam {

  @ApiModelProperty(value = "开始时间", name = "startTime")
  @JsonFormat(pattern = Constants.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
  private Date startTime;

  @ApiModelProperty(value = "结束时间", name = "endTime")
  @JsonFormat(pattern = Constants.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
  private Date endTime;

  @ApiModelProperty(value = "定时内容", name = "crontab")
  private String crontab;

  public ScheduleParam() {}

  public ScheduleParam(Date startTime, Date endTime, String crontab) {
    this.startTime = startTime;
    this.endTime = endTime;
    this.crontab = crontab;
  }

  public Date getStartTime() {
    return startTime;
  }

  public void setStartTime(Date startTime) {
    this.startTime = startTime;
  }

  public Date getEndTime() {
    return endTime;
  }

  public void setEndTime(Date endTime) {
    this.endTime = endTime;
  }

  public String getCrontab() {
    return crontab;
  }

  public void setCrontab(String crontab) {
    this.crontab = crontab;
  }


  @Override
  public String toString() {
    return "ScheduleParam{" +
            "startTime=" + startTime +
            ", endTime=" + endTime +
            ", crontab='" + crontab + '\'' +
            '}';
  }
}
